import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

// 挂载图片资源  路径前缀
import { tgName, tmpName, bucketName } from "../base.config";

// 全局注册本地通用组件
import { SvgIcon, ConfigItem, Size, Thumbnail } from "vue-lcd-engine";

[SvgIcon, ConfigItem, Size, Thumbnail].forEach((component) => {
  console.log('component', component);
  Vue.component(component.name, component);
});

//引入全局公用样式
import "./styles/index.less";

import {
  Base,
  message,
  notification,
  Affix,
  Anchor,
  AutoComplete,
  Alert,
  Avatar,
  BackTop,
  Badge,
  Breadcrumb,
  Button,
  Calendar,
  Card,
  Collapse,
  Carousel,
  Cascader,
  Checkbox,
  Col,
  DatePicker,
  Divider,
  Dropdown,
  Form,
  FormModel,
  Icon,
  Input,
  InputNumber,
  Layout,
  List,
  LocaleProvider,
  Menu,
  Mentions,
  Modal,
  Pagination,
  Popconfirm,
  Popover,
  Progress,
  Radio,
  Rate,
  Row,
  Select,
  Slider,
  Spin,
  Statistic,
  Steps,
  Switch,
  Table,
  Transfer,
  Tree,
  TreeSelect,
  Tabs,
  Tag,
  TimePicker,
  Timeline,
  Tooltip,
  Upload,
  Drawer,
  Skeleton,
  Comment,
  // ColorPicker,
  ConfigProvider,
  Empty,
  Result,
  Descriptions,
  PageHeader,
  Space,
} from "ant-design-vue";

[
  Base,
  Affix,
  Anchor,
  AutoComplete,
  Alert,
  Avatar,
  BackTop,
  Badge,
  Breadcrumb,
  Button,
  Calendar,
  Card,
  Collapse,
  Carousel,
  Cascader,
  Checkbox,
  Col,
  DatePicker,
  Divider,
  Dropdown,
  Form,
  FormModel,
  Icon,
  Input,
  InputNumber,
  Layout,
  List,
  LocaleProvider,
  Menu,
  Mentions,
  Modal,
  Pagination,
  Popconfirm,
  Popover,
  Progress,
  Radio,
  Rate,
  Row,
  Select,
  Slider,
  Spin,
  Statistic,
  Steps,
  Switch,
  Table,
  Transfer,
  Tree,
  TreeSelect,
  Tabs,
  Tag,
  TimePicker,
  Timeline,
  Tooltip,
  Upload,
  Drawer,
  Skeleton,
  Comment,
  ConfigProvider,
  Empty,
  Result,
  Descriptions,
  PageHeader,
  Space,
].forEach((component) => {
  Vue.use(component);
});

Vue.prototype.$message = message;
Vue.prototype.$notify = notification;
Vue.prototype.$info = Modal.info;
Vue.prototype.$success = Modal.success;
Vue.prototype.$error = Modal.error;
Vue.prototype.$warning = Modal.warning;
Vue.prototype.$confirm = Modal.confirm;
Vue.prototype.$destroyAll = Modal.destroyAll;

// 环境模式挂载
Vue.prototype.$mode = process.env.VUE_APP_MODE;

// 天宫云 图床代理 +  运营端重构 专属存储桶名称
Vue.prototype.$imgUrl = tgName + "/" + bucketName;
// 临时文件地址代理
Vue.prototype.$tmpUrl = tmpName;

Vue.config.productionTip = false;

// 全局指令

// 功能区快捷指令
import button from "@/directives/button";
import loading from "@/directives/loading";

const directives = [
  {
    alias: "btn",
    directive: button,
  },
  {
    alias: "loading",
    directive: loading,
  },
];

directives.forEach((item) => {
  Vue.directive(item.alias, item.directive);
});

// 引入setter组件
import "./setter";
// 引入sider组件
import "./sider";

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
